<?php

namespace App\Resource\Backend;

use Hyperf\Resource\Json\JsonResource;

class UserSearchResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array
     */
    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'nick_name' => $this->nick_name,
            'real_name' => $this->real_name,
            'avatar' => $this->avatar ?? 'https://gas.msgqu.com/upload/2022-12-05/lriogR8Emp.jpg',
            'mobile' => $this->mobile,
            'sex' => $this->sex,
            'created_at' => $this->created_at->format('Y-m-d'),
        ];
    }
}
